﻿
using GCC.Container.Abstracts;

using GCCGrpc.IMServer;

using Grpc.Core;

namespace System.IMServer
{
    [GCCGRPCServer]
    public class IMGRPCServer : IMServerGrpc.IMServerGrpcBase
    {

        public override Task<GetAllUserResponse> GetAllUser(GetAllUserRequest request, ServerCallContext context)
        {
            return Task.Run(() =>
            {
                return WSManager.Instance.GetAllUser(request);
            });
        }
        public override Task<SendMessageToAllUserResponse> SendMessageToAllUser(SendMessageToAllUserRequest request, ServerCallContext context)
        {
            return Task.Run(() =>
            {
                return WSManager.Instance.SendMessageToAllUser(request);
            });
        }

        public override Task<SendMessageToUserResponse> SendMessageToUser(SendMessageToUserRequest request, ServerCallContext context)
        {
            return Task.Run(() =>
            {
                return WSManager.Instance.SendMessageToUser(request);
            });
        }

        public override Task<SendMessageToUserClientResponse> SendMessageToUserClient(SendMessageToUserClientRequest request, ServerCallContext context)
        {
            return Task.Run(() =>
            {
                return WSManager.Instance.SendMessageToUserClient(request);
            });
        }

        public override Task<ForcedOfflineResponse> ForcedOffline(ForcedOfflineRequest request, ServerCallContext context)
        {
            return Task.Run(() =>
            {
                return WSManager.Instance.ForcedOffline(request);
            });
        }
    }
}
